import request from '@/utils/request.js'

// 管理员登录
export const employeeLoginService = (data) => {
  return request.post('/employees/login', data)
}

export const employeeLogoutService = () => {
  return request.get('/employees/logout')
}

// 获取checkCode
export const employeeCheckCodeService = (checkCodeId) => {
  return request.get('/employees/checkCode', { params: { checkCodeId } })
}

// token续期
export const employeeRefreshTokenService = (username, refreshToken) => {
  return request.post('/employees/refreshToken', { username, refreshToken })
}

// 获取所有管理员信息
export const employeePageService = (params) => {
  return request.get('/employees/page', { params })
}

// 新增管理员信息
export const employeeAddService = (data) => {
  return request.post('/employees', data)
}

// 修改管理员信息
export const employeeUpdateService = (data) => {
  return request.put('/employees', data)
}

// 修改管理员个人信息
export const employeeUpdateMeService = (data) => {
  return request.put('/employees/me', data)
}

// 管理员修改个人密码
export const employeeUpdatePasswordService = (data) => {
  return request.put('/employees/password', data)
}

// （批量）删除管理员信息
export const employeeDeleteMultipleService = (data) => {
  return request.delete(`/employees/${data}`)
}

/* 
在 'GET' 请求中传递参数：提供 params 对象
在 'PUT', 'POST', 'DELETE 和 'PATCH' 中传递参数：提供 data 对象
*/
